package com.chapter8.example2;

/**
 * 工厂方法实现
 */
public interface IFactory {
    LeiFeng createLeiFeng();
}

class UndergraduateFactory implements IFactory {

    @Override
    public LeiFeng createLeiFeng() {
        return new Undergraduate();
    }
}

class VolunteerFactory implements IFactory{

    @Override
    public LeiFeng createLeiFeng() {
        return new Volunteer();
    }
}
